<extend name="Layout:form" />
<block name="title">
    <title>添加菜单</title>

</block>
<block name="subnav">
    <a class="add fb" href="__URL__/save"><em>添加记录</em></a>　
    <a class="on" href="__URL__/index"><em>记录管理</em></a>
</block>

<block name="main">
    <form name="myform" id="myform" action="__URL__/save" method="post">
        <table cellpadding=0 cellspacing=0 class="table_form" width="100%">
            <tr>
                <td width="200px" align="right">服务地点选择:</td>
                <td>
                    <select name="ace[location_p]" id="location_p">
                    </select>
                    <select name="ace[location_c]" id="location_c">
                    </select>
                    <select name="ace[location_a]" id="location_a">
                    </select>
                    <script src="__ROOT__/assets/js/admin/region_select.js"></script>
                    <script type="text/javascript">
                        new PCAS('ace[location_p]', 'ace[location_c]', 'ace[location_a]', '上海市', '', '');
                    </script>
                </td>
            </tr>
            <tr>
                <td width="200px" align="right">时间选择:</td>
                <td>
                    <script type="text/javascript" src="__ROOT__/assets/js/admin/time/jedate.js"></script>
                    <style>
                        body{ padding:50px 0 0 50px;}
                        .datainp{ width:200px; height:30px; border:1px #ccc solid;}
                        .datep{ margin-bottom:40px;}
                    </style>
                        <input class="datainp" name="ace[starttime]" id="starttime" type="text" placeholder="请选择" value="" readonly>至
                        <input class="datainp" name="ace[endtime]" id="endtime" type="text" placeholder="请选择" value="" readonly>
                    <script type="text/javascript">
                        jeDate({
                            dateCell:"#starttime",
                            format:"YYYY年MM月DD日 hh:mm:ss",
                            isinitVal:true,
                            isTime:true, //isClear:false,
                            minDate:"2014-09-19 00:00:00",
                            okfun:function(val){alert(val)}
                        })
                        jeDate({
                            dateCell:"#endtime",
                            format:"YYYY年MM月DD日 hh:mm:ss",
                            isinitVal:true,
                            isTime:true, //isClear:false,
                            minDate:"2014-09-19 00:00:00",
                            okfun:function(val){alert(val)}
                        })
                    </script>
                </td>
            </tr>
            <tr>
                <td width="200px" align="right">开始服务地点:</td>
                <td>
                    <input type="text" name="ace[started]" id="started">
                </td>
            </tr>
            <tr>
                <td width="200px" align="right">结束服务地点:</td>
                <td>
                    <input type="text" name="ace[ended]" id="ended">
                </td>
            </tr>
            <tr>
                <td width="200px" align="right">需要安全车辆的天数:</td>
                <td>
                    <input type="text" class="input-text " name="ace[daytime]" id="daytime" value="" size="40"/>
                </td>
            </tr>
            <tr>
                <td width="200px" align="right">每日工作量:</td>
                <td>
                    <select name="ace[worktime]" id="worktime">
                        <option value="0" <if condition="$rs[worktime] eq 0">selected</if>>请选择</option>
                        <option value="3" <if condition="$rs[worktime] eq 3">selected</if>>3</option>
                        <option value="6" <if condition="$rs[worktime] eq 6">selected</if>>6</option>
                        <option value="12" <if condition="$rs[worktime] eq 12">selected</if>>12</option>
                        <option value="24" <if condition="$rs[worktime] eq 24">selected</if>>全天</option>
                    </select>
                    小时
                </td>
            </tr>
            <tr>
                <td width="200px" align="right">客户前往其他城市:</td>
                <td>
                    <select name="ace[gocity]" id="gocity">
                        <option value="0">否</option>
                        <option value="1">是</option>
                    </select>

                    <span id="gocity_name" style="display: none">
                        请选择：
                        <select name="ace[gocity_p]" id="gocity_p">
                        </select>
                        <select name="ace[gocity_c]" id="gocity_c">
                        </select>
                        <select name="ace[gocity_a]" id="gocity_a">
                        </select>
                        <script type="text/javascript">
                            new PCAS('ace[gocity_p]', 'ace[gocity_c]', 'ace[gocity_a]', '上海市', '', '');
                        </script>
                    </span>
                    <script>
                        $("#gocity").click(function(){
                            if($("#gocity").val() == 1)
                            {
                                $("#gocity_name").css("display","block");
                            }
                            else
                            {
                                $("#gocity_name").css("display","none");
                            }
                        });
                    </script>
                </td>
            </tr>
            <tr>
                <td width="200px" align="right">车辆信息:</td>
                <td>
                    <table style="border: 1px solid black">
                        <tr>
                            <th style="background:darkgray;color: black;width: 150px;text-align: center">车辆类别</th>
                            <th style="background:darkgray;color: black;width: 150px;text-align: center">车辆座数</th>
                            <th style="background:darkgray;color: black;width: 150px;text-align: center">车辆数量</th>
                            <th style="background:darkgray;color: black;width: 150px;text-align: center">操作</th>
                        </tr>
                        <tr>
                            <td>
                                <select name="bus[bus_type][0]" id="bus_type[0]" style="width: 100px">
                                    <option value="1">普通车</option>
                                    <option value="2">防弹车</option>
                                </select>
                            </td>
                            <td>
                                <select name="bus[bus_type_num][0]" id="bus_type_num[0]" style="width: 100px">
                                    <foreach name="bus_type_num" key="key" item="value">
                                        <option value="{$key}">{$value}</option>
                                    </foreach>
                                </select>座
                            </td>
                            <td>
                                <input type="text" name="bus[bus_num][0]" id="bus_num[0]" value="1">
                            </td>
                            <td>
                                <input type="button" value="添加" id="bus_details" style="width: 50px">
                                <input type="button" value="删除" id="bus_delete" style="width: 50px">
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td width="200px" align="right">司机类型:</td>
                <td>                    <table style="border: 1px solid black">
                    <tr>
                        <th style="background:darkgray;color: black;width: 150px;text-align: center">安保司机</th>
                        <th style="background:darkgray;color: black;width: 150px;text-align: center">语言选择</th>
                        <th style="background:darkgray;color: black;width: 150px;text-align: center">司机数量</th>
                        <th style="background:darkgray;color: black;width: 150px;text-align: center">操作</th>
                    </tr>
                    <tr>
                        <td>
                            <select name="driver[driver_type][]" id="driver_type[]" style="width: 100px">
                                <option value="1">武装</option>
                                <option value="2">非武装</option>
                            </select>
                        </td>
                        <td>
                            <select name="driver[driver_lang_type][]" id="driver_lang_type[]" style="width: 100px">
                                <option value="1">译员司机</option>
                                <option value="2">普通司机</option>
                            </select>
                        </td>
                        <td>
                            <input type="text" name="driver[driver_num][]" id="driver_num[0]" value="1">
                        </td>
                        <td>
                            <input type="button" value="添加" id="driver_details" style="width: 50px">
                            <input type="button" value="删除" id="driver_delete" style="width: 50px">
                        </td>
                    </tr>
                </table>
                </td>
            </tr>
            <tr>
                <td width="200px" align="right">显示价格:</td>
                <td>
                    <input type="text" name="ace[price]" id="ace[price]">
                </td>
            </tr>
        </table>
        <div class="bk15"></div>
        <div class="btn">
            <input type="submit" name="dosubmit" id="dosubmit" value="提交" class='button'>&nbsp;<input type="reset" value="重置" class='button'>
        </div>
    </form>
</block>

<block name="footer">
    <script type="text/javascript">
        $(function() {
            $.formValidator.initConfig({formid:"myform",autotip:true,onerror:function(msg,obj){window.top.art.dialog({content:msg,lock:true}, function(){this.close();$(obj).focus();})}});
            $("#starttime").formValidator({onshow:"请输入服务时间",onfocus:"请输入服务时间",oncorrect:"输入正确"}).inputValidator({min:1,onerror:"请输入服务时间"});
            $("#title").formValidator({onshow:"请输入对应的中文语言名称",onfocus:"请输入对应的中文语言名称",oncorrect:"输入正确"}).inputValidator({min:1,onerror:"请输入对应的中文语言名称"});
            $("#daytime").formValidator({onshow:"请输入服务天数",onfocus:"请输入服务天数",oncorrect:"输入正确"}).inputValidator({min:1,onerror:"请输入服务天数"});
            $("#worktime").formValidator({tipid:'a_tip',onshow:"请选择每日工作量",onfocus:"请选择每日工作量",oncorrect:"选择正确"}).inputValidator({min:1,onerror:"请选择每日工作量"});
        });
    </script>
</block>